'----------------------------------------------
' Name: Ali Karbassi & Ben Sattler
' Date: February 15, 2007
' Description: Program 2
'              Class Madison
'----------------------------------------------
Public Class Madison
   Inherits House

   ''' <summary>
   ''' Constructor
   ''' </summary>
   ''' <param name="newID">House ID</param>
   ''' <remarks></remarks>
   Sub New(ByVal newID As String)

      _PriceSet = False
      ID = newID
      theCount += 1

   End Sub

   ''' <summary>
   ''' Returns House Type
   ''' </summary>
   ''' <value></value>
   ''' <returns></returns>
   ''' <remarks></remarks>
   Public Overrides ReadOnly Property Type() As String
      Get
         Return "Madison"
      End Get
   End Property

   ''' <summary>
   ''' Sets the rooms. Displays errors if not in the range or selected.
   ''' </summary>
   ''' <remarks></remarks>
   Public Overrides Sub setRooms()

      If Rooms < 2 Or Rooms > 4 Then
         Err.Raise(33401, "Property Rooms", "Must select number of rooms.")
      End If

   End Sub

   ''' <summary>
   ''' Sets the garages. Displays errors if not in the range or selected.
   ''' </summary>
   ''' <remarks></remarks>
   Public Overrides Sub setGarages()

      If Garages < 1 Or Garages > 3 Then
         Err.Raise(33403, "Property Garages", "Must select number of garages.")
      End If

   End Sub

   ''' <summary>
   ''' Sets the price. Raises event if ID has been changed.
   ''' </summary>
   ''' <remarks></remarks>
   Public Overrides Sub setPrice()

      If _PriceSet Then
         HasChanged(ID)
      End If

      _Price = 185000

      If Rooms = 3 Then
         _Price += 20000
      ElseIf Rooms = 4 Then
         _Price += 40000
      End If

      If Garages = 2 Then
         _Price += 3000
      ElseIf Garages = 3 Then
         _Price += 6000
      End If

      _PriceSet = True

   End Sub

End Class
